#ifndef HASHTABLE_H
#define HASHTABLE_H

#include "TreeNode.h"
#include "Semantic.h"
#include "common.h"

#define HASH_SIZE 1024
#define STACK_SIZE 128

typedef struct Entry_{
	char *name;
	Type type;
	struct Entry_ *next;	
	//struct Entry_ *prior;//and double link table still need head node	
	struct Entry_ *blkNext;
	int scope;
}Entry;

extern Entry *hashTable[HASH_SIZE];
extern Entry* blkStack[STACK_SIZE];
extern int top;	
extern int semantic_error;

void StkPush();
void StkPop();

void init();

Type getTable(char *name);

void varInsertTable(FieldList value);
int varInsertCheck(FieldList var);

int funcChk_Inst(Function func);

void structInsertTable(Structure structure);
int structInsertCheck(Structure structure);

#endif
